package com.jl.jlapp.db;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper
  extends SQLiteOpenHelper
{
  public static final String DB_NAME = "history_search";
  public static final String ID = "nameId";
  public static final String NAME = "name";
  private static Integer Version = Integer.valueOf(1);
  
  public DatabaseHelper(Context paramContext)
  {
    this(paramContext, "history_search", null, Version.intValue());
  }
  
  public DatabaseHelper(Context paramContext, String paramString, CursorFactory paramCursorFactory, int paramInt)
  {
    super(paramContext, paramString, paramCursorFactory, paramInt);
  }
  
  public void add(SQLiteDatabase paramSQLiteDatabase, String paramString)
  {
    ContentValues localContentValues = new ContentValues();
    localContentValues.put("name", paramString);
    paramSQLiteDatabase.insert("history_search", null, localContentValues);
  }
  
  public void delete(SQLiteDatabase paramSQLiteDatabase)
  {
    paramSQLiteDatabase.delete("history_search", null, null);
  }
  
  public void onCreate(SQLiteDatabase paramSQLiteDatabase)
  {
    paramSQLiteDatabase.execSQL("create table history_search(nameId Integer primary key autoincrement,name nvarchar(64))");
  }
  
  public void onUpgrade(SQLiteDatabase paramSQLiteDatabase, int paramInt1, int paramInt2)
  {
    paramSQLiteDatabase.execSQL("alter table  history_search add sex varchar(8)");
  }
  
  public Cursor select(SQLiteDatabase paramSQLiteDatabase)
  {
    return paramSQLiteDatabase.query("history_search", new String[] { "nameId", "name" }, null, null, null, null, null);
  }
  
  public void update(SQLiteDatabase paramSQLiteDatabase)
  {
    ContentValues localContentValues = new ContentValues();
    localContentValues.put("name", "aaa");
    paramSQLiteDatabase.update("history_search", localContentValues, "name=?", new String[] { "张三" });
  }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/db/DatabaseHelper.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */